﻿using DevExpress.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
using TestingApp.Pages;
using TestingApp.Services;

namespace TestingApp.ViewModels {
    public class MainViewModel  : BindableBase {


        private readonly PageService _navigation;
        public Page CurrentPage { get; set; }

        public MainViewModel(PageService navigation)  {
            navigation.OnPageChanged += page => CurrentPage = page;
            navigation.Navigate(new SelectRolePage());
            _navigation = navigation;
        }

        public ICommand GoToBack => new DelegateCommand(() => { 
              _navigation.GoToBack();
        }, ()=>_navigation.CanGoToBack);




    }
}
